<html>

	<head>
	
	<?php
	
	
	
	?>
	
		<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>
		<script language="javascript" src="../js/jquery.MultiFile.pack.js"></script>

		<script language="javascript">
		
			$(document).ready(function(){
			
				$('#article').blur(function(){
					$('#cfname').val($('#article').val());
					$('#cfemail').val($('#article').val());
					$('#im1').val($('#cfname').val() + '0');
					$('#im2').val($('#cfname').val() + '1');
					$('#im3').val($('#cfname').val() + '2');
					$('#im4').val($('#cfname').val() + '3');
					$('#im5').val($('#cfname').val() + '4');
					$('#im6').val($('#cfname').val() + '5');

					});
				
			});
		</script>
	
	</head>
	
	<body>
	
<?php

	$accion = $_GET['accion'];

	if ($accion == 'nuevo') {

		echo "
		
		<div id='titulo'>Crear Articulo</div>

		<div id='contenedor12'>
			<form action='insnuevoarticulo.php' method='POST'>
			<div id='contenedor13'>Id:</div>
			<div id='contenedor14'><input id='article' type='text' name='id' size=15 required autofocus>*</div>

			<div id='contenedor13'>Marca:</div>
			<div id='contenedor14'><input id='marcac' type='text' name='marca' size=15 required>*</div>

			<div id='contenedor13'>Modelo:</div>
			<div id='contenedor14'><input type='text' name='modelo' size=25 required>*</div>

			<div id='contenedor13'>Talla:</div>
			<div id='contenedor14'><input id='talla' type='text' name='talla' size=25>*</div>

			<div id='contenedor13'>Dia/Noche:</div>
			<div id='contenedor14'><select name='utilizacion'>
				<option value='nos'>Selecciona una:</option>
				<option value='Dia'>Dia</option>
				<option value='Noche'>Noche</option>
				<option value='Indistinto'>Indistinto</option>
				</select>
			</div>

			<div id='contenedor13'>Absorcion:</div>
			<div id='contenedor14'><select name='catabsorcion'>
				<option value='nos'>Selecciona una:</option>
				<option value='1'>1</option>
				<option value='2'>2</option>
				<option value='3'>3</option>
				<option value='4'>4</option>
				<option value='5'>5</option>
				<option value='6'>6</option>
				<option value='7'>7</option>
				<option value='8'>8</option>
				<option value='9'>9</option>
				<option value='10'>10</option>
				</select>
			</div>

			<div id='contenedor13'>Absorcion (Ml):</div>
			<div id='contenedor14'><input type='text' name='mlabsorcion' required>*</div>

			<div id='contenedor13'>Cantidad por Paquete:</div>
			<div id='contenedor14'><input id='can' type='text' name='cantidadpaquete'></div>

			<div id='contenedor13'>Tipo de Usuario:</div>
			<div id='contenedor14'><select name='tipopersona'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='MNA'>Masculino,Nino,Adulto</option>
				<option value='FNA'>Femenino,Nino,Adulto</option>
				<option value='MFNA'>Masculino,Femenino,Nino,Adulto</option>
				<option value='MA'>Masculino,Adulto</option>
				<option value='FA'>Femenino,Adulto</option>
				<option value='MFA'>Masculino,Femenino,Adulto</option>
				<option value='MN'>Masculino Nino</option>
				<option value='FN'>Femenino,Nino</option>
				<option value='MFN'>Masculino,Femenino,Nino</option>
				</select>
			</div>

			<div id='contenedor13'>Material Exterior:</div>
			<div id='contenedor14'><select name='matexterior'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Tela'>Tela</option>
				<option value='Plastico'>Plastico</option>
				<option value='Otros'>Otros</option>
				</select>
			</div>

			<div id='contenedor13'>Material Interior:</div>
			<div id='contenedor14'><select name='matinterior'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Algodon'>Algodon</option>
				<option value='Polimero'>Polimero</option>
				<option value='Tela'>Tela</option>
				<option value='Otros'>Otros</option>
				</select>
			</div>

			<div id='contenedor13'>Numero de Cierres:</div>
			<div id='contenedor14'><input type='text' name='numcierres' size=2 required>*</div>

			<div id='contenedor13'>Tipo de Cierres:</div>
			<div id='contenedor14'><select name='tipocierres'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Velcro'>Velcro</option>
				<option value='Doble Velcro'>Doble Velcro</option>
				<option value='Pegatina'>Pegatina</option>
				<option value='Doble Pegatina'>Doble Pegatina</option>
				</select>*
			</div>

			<div id='contenedor13'>Tipo</div>
			<div id='contenedor14'><select name='tipo'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Bragapanal'>Bragapanal</option>
				<option value='Slip'>Slip</option>
				<option value='Boxer'>Boxer</option>
				<option value='Flex'>Flex</option>
				<option value='Compresa'>Compresa</option>
				</select>*
			</div>

			<div id='contenedor13'>Descripcion:</div>
			<div id='contenedor14'><textarea rows=10 cols=59 name='descripcion' required></textarea>*</div>

			<div id='contenedor13'>Deseo:</div>
			<div id='contenedor14'><select name='deseo'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Si'>Si</option>
				<option value='No'>No</option>
				</select>
			</div>

			<div id='contenedor13' style='visibility:hidden'>Imagenes:</div>
			<div id='contenedor14'>
				<input style='visibility:hidden' id='im1' type='text' name='imagen' size=15 value='Imagen 1'>
				<input style='visibility:hidden' id='im2' type='text' name='imagena' size=15 value='Imagen 2'>
				<input style='visibility:hidden' id='im3' type='text' name='imagenb' size=15 value='Imagen 3'>
				<input style='visibility:hidden' id='im4' type='text' name='imagenc' size=15 value='Imagen 4'>
				<input style='visibility:hidden' id='im5' type='text' name='imagend' size=15 value='Imagen 5'>
				<input style='visibility:hidden' id='im6' type='text' name='imagene' size=15 value='Imagen 6'>
			</div>

			<div id='contenedor13'></div>
			<div id='contenedor14'><input type='submit' value='Guardar'></div>

			</form>
			
			<div id='contenedor13'></div>
			<div id='contenedor14'>* Campo Obligatorio</div>
		</div>

			<div id='contenedor12'>
				<form action='upload.php' id='frm_uploader' name='frm_uploader' method='post' enctype='multipart/form-data'>
					<ol style='list-style-type: none'>
		
					<li>
					<div id='contenedor13'>
					<label>Nombre Imagen:</label>
					</div>
					<div id='contenedor14'>
					<input type='text' id='cfname' name='fname' size='30' class='required' readonly='readonly' placeholder='Campo automatico'/>
					</div>
					</li>
					
					<li>
					<div id='contenedor13'>
					<label>Carpeta:</label>
					</div>
					<div id='contenedor14'>			
					<input type='text' id='cfemail' name='farchivo' size='30' class='required email' readonly='readonly' placeholder='Campo automatico' />
					</div>
					</li>
					
					<li>
					<div id='contenedor13'>	
					<label>Selecciona Imagenes:</label>
					</div>
					<div id='contenedor14'>
					<input name='ffoto[]' type='file' class='multi' accept='gif|jpg|jpeg|png|pdf|zip|rar|ai|eps|mp3|avi|wmv|mpg|mpeg|cdr' />
					</div>
					</li>
					
					
					<li><p align='center'><div id='contenedor13'></div><div id='contenedor14'><input id='subir' type='submit' name='submit' value='Subir' class='btn' /></div></p></li>
					</ol>
					</fieldset>
				</form>
			</div>
		
	";

	}
	
	
	
	
	
	
		if ($accion == 'modificararticulo') {
		
		$artsel = $_GET['id'];
		
		$conexion = mysql_connect($servidor,$usuario,$clave);
		mysql_select_db($bd,$conexion);

		$peticion = mysql_query("SELECT * FROM articulos WHERE id=$artsel");
		
		while ($fila = mysql_fetch_array($peticion)){

			echo "
		
			<div id='titulo'>Crear Articulo</div>

			<div id='contenedor12'>
				<form action='actualizararticulo.php' method='POST'>
				<div id='contenedor13'>Id:</div>
				<div id='contenedor14'><input id='article' type='text' name='id' size=15 value=".$fila['id']." required autofocus>*</div>

				<div id='contenedor13'>Marca:</div>
				<div id='contenedor14'><input id='marcac' type='text' name='marca' size=15 value=".$fila['marca']." required>*</div>

				<div id='contenedor13'>Modelo:</div>
				<div id='contenedor14'><input type='text' name='modelo' size=15 value=".$fila['modelo']." required>*</div>

				<div id='contenedor13'>Talla:</div>
				<div id='contenedor14'><input id='talla' type='text' name='talla' size=15 value=".$fila['talla'].">*</div>

				<div id='contenedor13'>Dia/Noche:</div>
				<div id='contenedor14'><select name='utilizacion'>
					<option value=".$fila['utilizacion'].">".$fila['utilizacion']."</option>
					<option value='Dia'>Dia</option>
					<option value='Noche'>Noche</option>
					</select>
				</div>

				<div id='contenedor13'>Absorcion:</div>
				<div id='contenedor14'><select name='catabsorcion'>
					<option value=".$fila['catabsorcion'].">".$fila['catabsorcion']."</option>
					<option value='1'>1</option>
					<option value='2'>2</option>
					<option value='3'>3</option>
					<option value='4'>4</option>
					<option value='5'>5</option>
					<option value='6'>6</option>
					<option value='7'>7</option>
					<option value='8'>8</option>
					<option value='9'>9</option>
					<option value='10'>10</option>
					</select>
				</div>

				<div id='contenedor13'>Absorcion (Ml):</div>
				<div id='contenedor14'><input type='text' name='mlabsorcion' value=".$fila['mlabsorcion']." required>*</div>

				<div id='contenedor13'>Cantidad por Paquete:</div>
				<div id='contenedor14'><input id='can' type='text' name='cantidadpaquete' value=".$fila['cantidadpaquete']."></div>

				<div id='contenedor13'>Tipo de Usuario:</div>
				<div id='contenedor14'><select name='tipopersona'>
					<option value=".$fila['tipopersona']."'>".$fila['tipopersona']."</option>
					<option value='MNA'>Masculino,Nino,Adulto</option>
					<option value='FNA'>Femenino,Nino,Adulto</option>
					<option value='MFNA'>Masculino,Femenino,Nino,Adulto</option>
					<option value='MA'>Masculino,Adulto</option>
					<option value='FA'>Femenino,Adulto</option>
					<option value='MFA'>Masculino,Femenino,Adulto</option>
					<option value='MN'>Masculino Nino</option>
					<option value='FN'>Femenino,Nino</option>
					<option value='MFN'>Masculino,Femenino,Nino</option>
					</select>
				</div>

				<div id='contenedor13'>Material Exterior:</div>
				<div id='contenedor14'><select name='matexterior'>
					<option value=".$fila['matexterior'].">".$fila['matexterior']."</option>
					<option value='Tela'>Tela</option>
					<option value='Plastico'>Plastico</option>
					<option value='Otros'>Otros</option>
					</select>
				</div>

				<div id='contenedor13'>Material Interior:</div>
				<div id='contenedor14'><select name='matinterior'>
					<option value=".$fila['matinterior'].">".$fila['matinterior']."</option>
					<option value='Algodon'>Algodon</option>
					<option value='Polimero'>Polimero</option>
					<option value='Tela'>Tela</option>
					<option value='Otros'>Otros</option>
					</select>
				</div>

				<div id='contenedor13'>Numero de Cierres:</div>
				<div id='contenedor14'><input type='text' name='numcierres' size=2 value=".$fila['numcierres']." required>*</div>

				<div id='contenedor13'>Tipo de Cierres:</div>
				<div id='contenedor14'><select name='tipocierres'>
					<option value=".$fila['tipocierres'].">".$fila['tipocierres']."</option>
					<option value='Velcro'>Velcro</option>
					<option value='Doble Velcro'>Doble Velcro</option>
					<option value='Pegatina'>Pegatina</option>
					<option value='Doble Pegatina'>Doble Pegatina</option>
					</select>*
				</div>

				<div id='contenedor13'>Tipo</div>
				<div id='contenedor14'><select name='tipo'>
					<option value=".$fila['tipo'].">".$fila['tipo']."</option>
					<option value='Bragapanal'>Bragapanal</option>
					<option value='Slip'>Slip</option>
					<option value='Boxer'>Boxer</option>
					<option value='Flex'>Flex</option>
					<option value='Compresa'>Compresa</option>
					</select>*
				</div>

				<div id='contenedor13'>Descripcion:</div>
				<div id='contenedor14'><textarea rows=10 cols=59 name='descripcion' required>".$fila['descripcion']."</textarea>*</div>

				<div id='contenedor13'>Deseo:</div>
				<div id='contenedor14'><select name='deseo'>
					<option value=".$fila['deseo'].">".$fila['deseo']."</option>
					<option value='Si'>Si</option>
					<option value='No'>No</option>
					</select>
				</div>

				<div id='contenedor13' style='visibility:hidden'>Imagenes:</div>
				<div id='contenedor14'>
					<input style='visibility:hidden' id='im1' type='text' name='imagen' size=15 value=".$fila['imagen'].">
					<input style='visibility:hidden' id='im2' type='text' name='imagena' size=15 value=".$fila['imagena'].">
					<input style='visibility:hidden' id='im3' type='text' name='imagenb' size=15 value=".$fila['imagenb'].">
					<input style='visibility:hidden' id='im4' type='text' name='imagenc' size=15 value=".$fila['imagenc'].">
					<input style='visibility:hidden' id='im5' type='text' name='imagend' size=15 value=".$fila['imagend'].">
					<input style='visibility:hidden' id='im6' type='text' name='imagene' size=15 value=".$fila['imagene'].">
				</div>

				<div id='contenedor13'></div>
				<div id='contenedor14'><input type='submit' value='Guardar'></div>

				</form>
				
				<div id='contenedor13'></div>
				<div id='contenedor14'>* Campo Obligatorio</div>
			</div>

				<div id='contenedor12'>
					<form action='upload.php' id='frm_uploader' name='frm_uploader' method='post' enctype='multipart/form-data'>
						<ol style='list-style-type: none'>
			
						<li>
						<div id='contenedor13'>
						<label>Nombre Imagen:</label>
						</div>
						<div id='contenedor14'>
						<input type='text' id='cfname' name='fname' size='30' class='required' readonly='readonly' placeholder='Campo automatico'/>
						</div>
						</li>
						
						<li>
						<div id='contenedor13'>
						<label>Carpeta:</label>
						</div>
						<div id='contenedor14'>			
						<input type='text' id='cfemail' name='farchivo' size='30' class='required email' readonly='readonly' placeholder='Campo automatico' />
						</div>
						</li>
						
						<li>
						<div id='contenedor13'>	
						<label>Selecciona Imagenes:</label>
						</div>
						<div id='contenedor14'>
						<input name='ffoto[]' type='file' class='multi' accept='gif|jpg|jpeg|png|pdf|zip|rar|ai|eps|mp3|avi|wmv|mpg|mpeg|cdr' />
						</div>
						</li>
						
						
						<li><p align='center'><div id='contenedor13'></div><div id='contenedor14'><input id='subir' type='submit' name='submit' value='Subir' class='btn' /></div></p></li>
						</ol>
						</fieldset>
					</form>
				</div>
		
		";
	}
}
	
	
	
	
	
	
	
	
$accion = $_GET['accion'];

	if ($accion == 'construir') {
	
	$conexion = mysql_connect($servidor,$usuario,$clave);
	mysql_select_db($bd,$conexion);
						
	$peticion = mysql_query("SELECT * FROM articulos");

		echo "
		
		<div id='titulo'>Construir Articulo</div>

		<div id='contenedor12'>
			<form action='insconstruirarticulo.php' method='POST'>
			
			<div id='contenedor13'>Primer Articulo</div>
			<div id='contenedor14'>
				<select name='articulo1'>
					<option value=''>Selecciona Articulo</option>
		";
		
			while ($fila = mysql_fetch_array($peticion)){
			
			echo "
			
					<option value=".$fila['id'].">".$fila['marca']." ".$fila['modelo']." ".$fila['talla']."</option>
			
			";
			
			}
		
		echo "
				</select>
				Unidades: <input id='article' type='text' name='unia' size=3 required autofocus>*
			</div>
			
			<div id='contenedor13'>Segundo Articulo</div>
			<div id='contenedor14'>
				<select name='articulo2'>
					<option value=''>Selecciona Articulo</option>
		";
		
			$conexion = mysql_connect($servidor,$usuario,$clave);
			mysql_select_db($bd,$conexion);
						
			$peticion = mysql_query("SELECT * FROM articulos");
		
			while ($fila = mysql_fetch_array($peticion)){
			
			echo "
			
					<option value=".$fila['id'].">".$fila['marca']." ".$fila['modelo']." ".$fila['talla']."</option>
			
			";
			
			}
		
		
		echo "
				</select>
				Unidades: <input id='article' type='text' name='unib' size=3 required autofocus>*
			</div>
			
			<div id='contenedor13'>Tercer Articulo</div>
			<div id='contenedor14'>
				<select name='articulo3'>
					<option value=''>Selecciona Articulo</option>
		";
		
			$conexion = mysql_connect($servidor,$usuario,$clave);
			mysql_select_db($bd,$conexion);
						
			$peticion = mysql_query("SELECT * FROM articulos");
		
			while ($fila = mysql_fetch_array($peticion)){
			
			echo "
			
					<option value=".$fila['id'].">".$fila['marca']." ".$fila['modelo']." ".$fila['talla']."</option>
			
			";
			
			}		
		
		echo "
				</select>
				Unidades: <input id='article' type='text' name='unic' size=3 required autofocus>*
			</div>
			
			<div id='contenedor13'>Id:</div>
			<div id='contenedor14'><input id='article' type='text' name='id' size=15 required autofocus>*</div>

			<div id='contenedor13'>Modelo:</div>
			<div id='contenedor14'><input type='text' name='modelo' size=25 required>*</div>

			<div id='contenedor13'>Talla:</div>
			<div id='contenedor14'><input id='talla' type='text' name='talla' size=25>*</div>

			<div id='contenedor13'>Dia/Noche:</div>
			<div id='contenedor14'><select name='utilizacion'>
				<option value='nos'>Selecciona una:</option>
				<option value='Dia'>Dia</option>
				<option value='Noche'>Noche</option>
				<option value='Indistinto'>Indistinto</option>
				</select>
			</div>

			<div id='contenedor13'>Absorcion:</div>
			<div id='contenedor14'><select name='catabsorcion'>
				<option value='nos'>Selecciona una:</option>
				<option value='1'>1</option>
				<option value='2'>2</option>
				<option value='3'>3</option>
				<option value='4'>4</option>
				<option value='5'>5</option>
				<option value='6'>6</option>
				<option value='7'>7</option>
				<option value='8'>8</option>
				<option value='9'>9</option>
				<option value='10'>10</option>
				</select>
			</div>

			<div id='contenedor13'>Absorcion (Ml):</div>
			<div id='contenedor14'><input type='text' name='mlabsorcion' required>*</div>

			<div id='contenedor13'>Tipo de Usuario:</div>
			<div id='contenedor14'><select name='tipopersona'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='MNA'>Masculino,Nino,Adulto</option>
				<option value='FNA'>Femenino,Nino,Adulto</option>
				<option value='MFNA'>Masculino,Femenino,Nino,Adulto</option>
				<option value='MA'>Masculino,Adulto</option>
				<option value='FA'>Femenino,Adulto</option>
				<option value='MFA'>Masculino,Femenino,Adulto</option>
				<option value='MN'>Masculino Nino</option>
				<option value='FN'>Femenino,Nino</option>
				<option value='MFN'>Masculino,Femenino,Nino</option>
				</select>
			</div>

			<div id='contenedor13'>Material Exterior:</div>
			<div id='contenedor14'><select name='matexterior'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Tela'>Tela</option>
				<option value='Plastico'>Plastico</option>
				<option value='Otros'>Otros</option>
				</select>
			</div>

			<div id='contenedor13'>Material Interior:</div>
			<div id='contenedor14'><select name='matinterior'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Algodon'>Algodon</option>
				<option value='Polimero'>Polimero</option>
				<option value='Tela'>Tela</option>
				<option value='Otros'>Otros</option>
				</select>
			</div>

			<div id='contenedor13'>Numero de Cierres:</div>
			<div id='contenedor14'><input type='text' name='numcierres' size=2 required>*</div>

			<div id='contenedor13'>Tipo de Cierres:</div>
			<div id='contenedor14'><select name='tipocierres'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Velcro'>Velcro</option>
				<option value='Doble Velcro'>Doble Velcro</option>
				<option value='Pegatina'>Pegatina</option>
				<option value='Doble Pegatina'>Doble Pegatina</option>
				</select>*
			</div>

			<div id='contenedor13'>Tipo</div>
			<div id='contenedor14'><select name='tipo'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Bragapanal'>Bragapanal</option>
				<option value='Slip'>Slip</option>
				<option value='Boxer'>Boxer</option>
				<option value='Flex'>Flex</option>
				<option value='Compresa'>Compresa</option>
				</select>*
			</div>

			<div id='contenedor13'>Descripcion:</div>
			<div id='contenedor14'><textarea rows=10 cols=59 name='descripcion' required></textarea>*</div>

			<div id='contenedor13'>Deseo:</div>
			<div id='contenedor14'><select name='deseo'>
			      	<option value='nos'>Selecciona una:</option>
				<option value='Si'>Si</option>
				<option value='No'>No</option>
				</select>
			</div>

			<div id='contenedor13' style='visibility:hidden'>Imagenes:</div>
			<div id='contenedor14'>
				<input style='visibility:hidden' id='im1' type='text' name='imagen' size=15 value='Imagen 1'>
				<input style='visibility:hidden' id='im2' type='text' name='imagena' size=15 value='Imagen 2'>
				<input style='visibility:hidden' id='im3' type='text' name='imagenb' size=15 value='Imagen 3'>
				<input style='visibility:hidden' id='im4' type='text' name='imagenc' size=15 value='Imagen 4'>
				<input style='visibility:hidden' id='im5' type='text' name='imagend' size=15 value='Imagen 5'>
				<input style='visibility:hidden' id='im6' type='text' name='imagene' size=15 value='Imagen 6'>
			</div>

			<div id='contenedor13'></div>
			<div id='contenedor14'><input type='submit' value='Guardar'></div>

			</form>
			
			<div id='contenedor13'></div>
			<div id='contenedor14'>* Campo Obligatorio</div>
		</div>

			<div id='contenedor12'>
				<form action='upload.php' id='frm_uploader' name='frm_uploader' method='post' enctype='multipart/form-data'>
					<ol style='list-style-type: none'>
		
					<li>
					<div id='contenedor13'>
					<label>Nombre Imagen:</label>
					</div>
					<div id='contenedor14'>
					<input type='text' id='cfname' name='fname' size='30' class='required' readonly='readonly' placeholder='Campo automatico'/>
					</div>
					</li>
					
					<li>
					<div id='contenedor13'>
					<label>Carpeta:</label>
					</div>
					<div id='contenedor14'>			
					<input type='text' id='cfemail' name='farchivo' size='30' class='required email' readonly='readonly' placeholder='Campo automatico' />
					</div>
					</li>
					
					<li>
					<div id='contenedor13'>	
					<label>Selecciona Imagenes:</label>
					</div>
					<div id='contenedor14'>
					<input name='ffoto[]' type='file' class='multi' accept='gif|jpg|jpeg|png|pdf|zip|rar|ai|eps|mp3|avi|wmv|mpg|mpeg|cdr' />
					</div>
					</li>
					
					
					<li><p align='center'><div id='contenedor13'></div><div id='contenedor14'><input id='subir' type='submit' name='submit' value='Subir' class='btn' /></div></p></li>
					</ol>
					</fieldset>
				</form>
			</div>
		
	";

	}

	
	

?>




</body>
	</html>	
	
